package com.my.ads.lib.live.service;

import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.RequiresApi;

/**
 * Created by xuanyang on 2018/3/27.
 */

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class JobSchedulerService extends JobService {

    @Override
    public boolean onStopJob(JobParameters params) {
        return false;
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    public boolean onStartJob(JobParameters params) {
        //TODO 保活之后执行的操作
        try {
            Intent tmp = new Intent(this, LiveService.class);
            startService(tmp);
            jobFinished(params, false);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return false;
    }


}